/// @description 旋转方块组
// @argument0 方块组
// @argument1 旋转方向
var boxs = argument[0];
var roat = argument[1];

for(var i=0;i<4;i++)
{
	var bb = boxs.box[i];
	var len = point_distance(boxs.x, boxs.y, bb.x, bb.y);
	var dir = point_direction(boxs.x, boxs.y, bb.x, bb.y);
	bb.x = boxs.x+lengthdir_x(len, dir+90*roat);
	bb.y = boxs.y+lengthdir_y(len, dir+90*roat);
}

//检查变身之后是否重叠
is_chong = false;
for(var i=0;i<4;i++)
{
	var bb = boxs.box[i];
	with(bb)
	{
		var coli = collision_point(x, y, oBox, false, true);
		if(coli)
		{
			other.is_chong = true;
			break;
		}
	}
}

//回退原样
if(is_chong)
{
	for(var i=0;i<4;i++)
	{
		var bb = boxs.box[i];
		var len = point_distance(boxs.x, boxs.y, bb.x, bb.y);
		var dir = point_direction(boxs.x, boxs.y, bb.x, bb.y);
		bb.x = boxs.x+lengthdir_x(len, dir-90*roat);
		bb.y = boxs.y+lengthdir_y(len, dir-90*roat);
	}
}
